#define ls(x) (x << 1)
#define rs(x) (x << 1 | 1)

using namespace std;
using ll = long long;

const int N = 1e5 + 5;
struct node {
  int l, r;
  double mxv;
  int len;
}tr[N << 2];

void build(int u, int l, int r) {
  tr[u] = {l, r, -1.0, 0};	
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(u << 1, l, mid);
  build(u << 1 | 1, mid + 1, r);
}

int query(int u, double k) {
  if (tr[u].l == tr[u].r) {
    return tr[u].mxv > k;
  }
  if (tr[ls(u)].mxv > k) {
    return query(ls(u), k) + tr[u].len - tr[ls(u)].len;
  }
  return query(rs(u), k);
}

void push_up(int u) {
  tr[u].mxv = max(tr[ls(u)].mxv, tr[rs(u)].mxv);
  tr[u].len = tr[ls(u)].len + query(rs(u), tr[ls(u)].mxv);
}

void modify(int u, int p, int v) {
  if (tr[u].l == tr[u].r) {
    tr[u].mxv = 1.0 * v / p;
    tr[u].len = 1;
    return;
  }
  int mid = (tr[u].l + tr[u].r) >> 1;
  if (p <= mid) {
    modify(ls(u), p, v);
  } else {
    modify(rs(u), p, v);
  }
  push_up(u);
}
void solve()
{
  int n, q;
  cin >> n >> q;

  build(1, 1, n);
  for (int i = 1; i <= q; i++) {
    int p, v;
    cin >> p >> v;
    modify(1, p, v);
    cout << tr[1].len << '\n';
  }
}